[QUIZ] Test your understanding of SQL - Part 7
Part 7 of the SQL quiz goes into the SQL practice exercises that follow the previous period.
- Question 1: What is the result of the following SQL statement?
SELECT COUNT(DISTINCT STUDENT_ID) FROM EXAM_RESULTS;
- 3
- 4
- 5
- 6
-
- Question 2: Which SQL statement is used to calculate the average test score for the 1st test?
- SELECT AVG (DIEM_KT) FROM KETQUA_KIEMTRA;
- SELECT AVG (DIEM_KT) FROM KETQUA_KIEMTRA WHERE ID_BAIKT = 1;
- SELECT AVG (DIEM_KT) FROM KETQUA_KIEMTRA GROUP BY ID_BAIKT;
- SELECT COUNT (DIEM_KT) FROM KETQUA_KIEMTRA WHERE ID_BAIKT = 1;
-
- Question 3: Which SQL statement is used to calculate each test how many students have done?
- SELECT COUNT (DISTINCT ID_SV) FROM KETQUA_KIEMTRA GROUP BY ID_BAIKT;
- SELECT ID_BAIKT, MAX (ID_SV) FROM KETQUA_KIEMTRA GROUP BY ID_BAIKT;
- SELECT ID_BAIKT, COUNT (DISTINCT ID_SV) FROM KETQUA_KIEMTRA GROUP BY ID_BAIKT;
- SELECT ID_BAIKT, MIN (ID_SV) FROM KETQUA_KIEMTRA GROUP BY ID_BAIKT;
-
- Question 4: Which SQL statement is used to print out the record of all students who start with 'L'?
- SELECT * FROM KETQUA_KIEMTRA WHERE HO_SV LIKE 'L%';
- SELECT * FROM KETQUA_KIEMTRA WHERE HO_SV LIKE 'L';
- SELECT * FROM KETQUA_KIEMTRA WHERE HO_SV = 'L';
- SELECT * FROM KETQUA_KIEMTRA WHERE HO_SV <> 'L';
-
- Question 5: What is the result of the following SQL statement?
SELECT MAX(DIEM_KT) FROM KETQUA_KIEMTRA WHERE ID_BAIKT = 1 AND HO_SV LIKE '%U%';
- 95
- 85
- 100
- 78
-
- Question 6: Which SQL statement is used to print out the records of all students whose first or last name ends with 'N'?
- SELECT * FROM KETQUA_KIEMTRA WHERE TEN_SV LIKE '% N' OR HO_SV LIKE '% N';
- SELECT * FROM KETQUA_KIEMTRA WHERE TEN_SV LIKE 'N' OR HO_SV LIKE 'N';
- SELECT * FROM KETQUA_KIEMTRA WHERE TEN_SV LIKE 'N%' OR HO_SV LIKE 'N%';
- SELECT * FROM KETQUA_KIEMTRA WHERE TEN_SV LIKE '% N%' OR HO_SV LIKE '% N%';
-
- Question 7: Which SQL statement is used to find the names of all students who score higher than 90 on the 2nd test?
- SELECT TEN_SV, HO_SV FROM KETQUA_KIEMTRA WHERE ID_BAIKT = 2 OR DIEM_KT> 90;
- SELECT TEN_SV, HO_SV FROM KETQUA_KIEMTRA WHERE ID_BAIKT = 2 AND DIEM_KT> 90;
- SELECT TEN_SV, HO_SV FROM KETQUA_KIEMTRA WHERE DIEM_KT> 90;
- SELECT TEN_SV, HO_SV FROM KETQUA_KIEMTRA WHERE ID_BAIKT = 2 HAVING DIEM_KT> 90;
-
- Question 8: Which SQL statement is used to find the names of all students who scored a total of 2 tests higher than 180?
- SELECT TEN_SV, HO_SV, SUM (DIEM_KT) FROM KETQUA_KIEMTRA GROUP BY TEN_SV, HO_SV;
- SELECT TEN_SV, HO_SV, SUM (DIEM_KT) FROM KETQUA_KIEMTRA HAVING SUM (DIEM_KT)> 180;
- SELECT TEN_SV, HO_SV, SUM (DIEM_KT) FROM KETQUA_KIEMTRA GROUP BY TEN_SV, HO_SV HAVING SUM (DIEM_KT)> 180;
- SELECT TEN_SV, HO_SV, SUM (DIEM_KT) FROM KETQUA_KIEMTRA WHERE DIEM_KT> 180 GROUP BY TEN_SV, HO_SV;
-
- Question 9: How many records have the following SQL statement generated?
SELECT * FROM KETQUA_KIEMTRA WHERE HO_SV LIKE '%U%' AND DIEM_KT > 75;
- 3
- 4
- 5
- There is no answer
-
- Question 10: How many records do the following SQL statements return?
SELECT * FROM KETQUA_KIEMTRA WHERE ID_SV <= 12 AND DIEM > 85;
- 5
- 4
- 3
- 2
-
3.5 ★ | 2 Vote
You should read it
- [QUIZ] Test your understanding of SQL - Part 4
- [QUIZ] Test your understanding of SQL - Part 3
- [QUIZ] Test your understanding of SQL - Part 5
- [QUIZ] Test your understanding of SQL - Part 1
- [QUIZ] Test your understanding of SQL - Part 6
- [QUIZ] Check your understanding of SQL - Part 2
- Test about database security P8
- What do you know about NoSQL Database?
- eQuiz - Multiple choice test on SQL
- Test about database security P12
- Test about database security P11
- Test of database security P9
Maybe you are interested
Tinder integrates a new AI tool to automatically select the most suitable profile photo for users
How to round the corners of a selection in Photoshop is simple and easy
Fix error The selected disk has an MBR partition table when installing Windows, MBR - GPT hard drive error
4 ways to select multiple files on Mac
Solve the Error of No Photos Selected on the Phone
How to Select All on Mac